using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_CurrencyMap : EntityTypeConfiguration<t_Currency>
    {
        public t_CurrencyMap()
        {
            // Primary Key
            this.HasKey(t => t.FCurrencyID);

            // Properties
            this.Property(t => t.FCurrencyID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FNumber)
                .IsRequired()
                .HasMaxLength(3);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FOperator)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FModifyTime)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("t_Currency");
            this.Property(t => t.FCurrencyID).HasColumnName("FCurrencyID");
            this.Property(t => t.FNumber).HasColumnName("FNumber");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FOperator).HasColumnName("FOperator");
            this.Property(t => t.FExchangeRate).HasColumnName("FExchangeRate");
            this.Property(t => t.FScale).HasColumnName("FScale");
            this.Property(t => t.FFixRate).HasColumnName("FFixRate");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FControl).HasColumnName("FControl");
            this.Property(t => t.FDeleted).HasColumnName("FDeleted");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
            this.Property(t => t.FSystemType).HasColumnName("FSystemType");
            this.Property(t => t.UUID).HasColumnName("UUID");
            this.Property(t => t.FClassTypeID).HasColumnName("FClassTypeID");
        }
    }
}
